// 类-继承和扩展
// 内容：
// 1. 继承
// 2. Mixin

void main() {
  Man man = new Man('joe', 12);
  man.drive();
  man.sing();

  Woman woman = new Woman('Mill', 18);
  woman.dance();
  woman.sing();
  woman.say();
}

class Person {
  Person(this._name, this._age);

  String _name;
  int _age;

  say(){
    print('$_name is $_age year old');
  }
}

class Man extends Person with singMixin{
  Man(super._name, super._age);

  drive(){
    print('dirve');
  }

  // sing(){
  //   print('sing');
  // }
}

class Woman extends Person with singMixin, danceMixin{
  Woman(super._name, super._age);

  // sing(){
  //   print('sing');
  // }
  // dance(){
  //   print('dance');
  // }
}

mixin singMixin{
  sing(){
    print('sing');
  }
}

mixin danceMixin{
  dance(){
    print('dance');
  }
}

